/*
 * LoadingDialog.java
 * business
 *
 * Created by ChenTao on 2017/1/18.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.ui.widget.dialog;

import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.widget.ImageView;

import com.yidiandao.business.R;

/** 加载中的对话框 */
public class LoadingDialog extends Dialog {

    private ImageView mIvLoading;

    private AnimationDrawable mAnimationDrawable;

    public LoadingDialog(Context context) {
        super(context, R.style.ThemeLoadingDialog);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_loading);

        initViews();
    }

    private void initViews() {
        mIvLoading = (ImageView) findViewById(R.id.iv_loading);
        mAnimationDrawable = (AnimationDrawable) mIvLoading.getDrawable();
        mAnimationDrawable.start();
    }
}
